def hanno(n,a,b,c):
    if n == 1:
        print(a, "---->",c)
        return None
    if n == 2:
        print(a,"----->", b)
        print(a,"----->",c)
        print(b,"------>",c)
        hanno(-1,a,c,b)
        print(a,"------>",c)
        hanno(n-1,b,a,c)
a = "A"
b = "B"
c = "C"
n = 3
hanno(n,a,b,c)